<script>
function showHelpMsg(obj){
	var str = $(obj).parent().find("textarea").html();
	art.alert("<div style='height: 100px;width:500px; overflow-y: scroll;'>"+$(obj).parent().find("textarea").html()+"</div>");
}

function do_sort(obj,sortType){
	location.href = "/${orgi}/user/report/view/${report.id!''}.html?sortType="+sortType+"&sortName="+encodeURIComponent(obj);
}
</script>
<#if reportModel??>
<table class="selectableTable <#if reportModel?? && reportModel.viewtype == 'view'>cz_${reportModel.id}</#if>" data-id="${reportModel.id!''}">
<thead>
<#if reportModel?? && reportModel.reportData?? && reportModel.reportData.col?? && reportModel.reportData.col.title??>
<#list reportModel.reportData.col.title as tlist>
<tr class="sortableTr">
<#if reportModel.reportData.col.title?size gt 1 && tlist_index == 0 && reportModel.reportData.row.title?size gt 0>
<td align="center" colspan="${reportModel.reportData.row.title?size}" rowspan="${reportModel.reportData.col.title?size-1}" class="s_blue"></td>	
</#if>
<#if (tlist_index+1) == reportModel.reportData.col.title?size && reportModel.reportData.row?? && reportModel.reportData.row.firstTitle??>
<#list reportModel.reportData.row.firstTitle as first>
<td align="center" data-title="${first.name?url}" data-flag="dim">
${first.rename!first.name!''}
<#if first.description??><img style="cursor: pointer;" onclick="showHelpMsg(this)" title="维度描述" width="10" height="10" src="/assets/images/help.png"></#if>
<textarea style="display: none">${first.description!''}</textarea>
</td>
</#list>
</#if>
<#if tlist??>
<#list tlist as tl>
<td  align="center"  <#if  tl.leveltype?? && tl.leveltype == "newcol">rowspan="${reportModel.reportData.col.title?size}"</#if> colspan="${tl.colspan}" >
${tl.rename!tl.name!""}		
<#if tl.description??><img style="cursor: pointer;" onclick="showHelpMsg(this)" title="指标描述" width="10" height="10" src="/assets/images/help.png"></#if>
<#if tl.leveltype??&&tl.leveltype != 'newcol'&&cube?? && cube.dstype=='table'><img style="cursor: pointer;" onclick="do_sort('${tl.formatName!''}',<#if reportModel.sortType??&&reportModel.sortType=='asc'>'desc'<#else>'asc'</#if>)" title="排序" width="10" height="10" <#if reportModel.sortName??&& (reportModel.sortName==tl.rename!tl.formatName) &&(reportModel.sortType=='asc')>src="/assets/images/arrow-up.png"<#elseif reportModel.sortName??&& (reportModel.sortName==tl.rename!tl.formatName) &&(reportModel.sortType=='desc')>src="/assets/images/arrow-down.png"<#else>src="/assets/images/report-view-sort.png"</#if>></#if>
<textarea style="display: none">${tl.description!''}</textarea>
</td>
</#list>
</#if>
</tr>
</#list>
</#if>
</thead>
<tbody>
<#if reportModel.reportData?? && reportModel.reportData.data??>
<#list reportModel.reportData.data as values>
<tr class="rowcell">	  
<#if reportModel.reportData.row?? && reportModel.reportData.row.title?? && reportModel.reportData.row.title?size gt 0>
<#list reportModel.reportData.row.title as tl>
<#assign rows = 0 >
<#list tl as title>
<#if title??>
<#if rows == values_index && title.name != "TOTAL_TEMP">
<#if title.leveltype != "newrow_extend_sum">
<td nowrap="nowrap" align="center" class="blue_k <#if title.total == true>total</#if>" rowspan="${title.rowspan!'0'}" <#if title.colspan gt 1>colspan="${title.colspan}"</#if>><#noescape>${title.formatName!''}</#noescape></td>
</#if>
<#if title.valueData??>
<#list title.valueData as value>
<#if value.merge==false>
<td rowspan="${value.rowspan}" colspan="${value.colspan}" align="center"  class="measure ${value.vtclass!''} <#if (values_index+1) % 2 == 1>cz_${reportModel.id}_odd cz_${value.dataid}_odd<#else>cz_${reportModel.id}_even cz_${value.dataid}_even</#if>  cz_${reportModel.id} cz_${value.dataid!''}" nowrap="nowrap" <#if value.cellmergeid??>data-cellmerge="${value.cellmergeid}"</#if>><#noescape>${value.valueStyle!value.foramatValue!''}</#noescape></td>
</#if>
</#list>
</#if>
</#if>
<#assign rows = rows + title.rowspan>
</#if>
</#list>
</#list>
<#else>
<#list values as value>
<td class="row ${value.vtclass!''} <#if (values_index+1) % 2 == 1>cz_${reportModel.id}_odd cz_${value.dataid}_odd<#else>cz_${reportModel.id}_even cz_${value.dataid}_even</#if>  cz_${reportModel.id} cz_${value.dataid!''}" style ="text-align: right;<#if value.valueType?? && value.valueType == 'total'>background-color:#c5daed;</#if>"><#noescape>${value.valueStyle!value.foramatValue!''}</#noescape></td>
</#list>
</#if>
</tr>
</#list>
</#if>
</tbody>
</table>
</#if>